# pull base image
# --------------
FROM kylin-server-v10-sp3-general-release-2206-loongarch64:b17

# Maintainer
# --------------
MAINTAINER suming  <suming@bessystem.com>

# Environment variables required for this build
# ---------------------------------------------
ENV JAVA_HOME=/usr/local/docker/java/jdk/loongson8.1.10-jdk8u312b07-linux-loongarch64
ENV CLASSPATH=$JAVA_HOME/bin
ENV PATH=.:$JAVA_HOME/bin:$PATH
ENV BES_MQ_HOME /opt/besmq

# Basic support
#-----------------------------
ADD jdk8u312b07-linux-loongarch64.tar.gz /usr/local/docker/java/jdk/
COPY net-tools-2.0-0.54.a.ky10.loongarch64.rpm /tmp/net-tools-2.0-0.54.a.ky10.loongarch64.rpm
COPY tar-1.30-11.a.ky10.loongarch64.rpm /tmp/tar-1.30-11.a.ky10.loongarch64.rpm
RUN mkdir -p $BES_MQ_HOME
COPY BESMQ-2.1.0.1584.tar.gz /tmp/BESMQ-2.1.0.1584.tar.gz
RUN rpm -iv /tmp/tar-1.30-11.a.ky10.loongarch64.rpm && \
    rpm -iv /tmp/net-tools-2.0-0.54.a.ky10.loongarch64.rpm && \
    tar -zxf /tmp/BESMQ-2.1.0.1584.tar.gz -C $BES_MQ_HOME && \
    chmod -R 755 $BES_MQ_HOME && ls -l $BES_MQ_HOME

#Setup besmq
#----------------------------------------------
EXPOSE 3100 3200 3300 8490
WORKDIR $BES_MQ_HOME
ENTRYPOINT cd bin; ./startconsole; tail -f /dev/null

